package com.contact.util.util.filters;


public class SearchDataFilter extends AbstractDataFilter<String, SearchCollection> {

    private static final long serialVersionUID = 6294174459003843815L;
    
    public SearchDataFilter(String key) {
        super(DataFilterType.SEARCH, key);
    }

    @Override
    public void setDisplayValue(String displayValue) {
        SearchCollection sc = getFilterValue();
        if(sc == null) {
            sc = new SearchCollection();
            setFilterValue(sc);
        }
        
        sc.setDisplayValue(displayValue);
        
        super.setDisplayValue(displayValue);
    }

    public void addFilter(String key, SearchType searchType) {
        
        SearchCollection sc = getFilterValue();
        if(sc == null) {
            sc = new SearchCollection();
            setFilterValue(sc);
        }
        
        sc.getWildCardMap().put(key, searchType);
        
    }

}
